<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <script src="https://unpkg.com/vue-router@4"></script>
</head>
<body>
    <div id="app">
        <router-link to="/">主页</router-link><br>
        <router-link to="/account">账户</router-link>
        <router-view></router-view>

    </div>
    <script>
        const Home={
            template:`<H2>这是主页</H2>`
        }
        const Account={
            template:`<H2>这是账户</H2>`
        }
const router=VueRouter .createRouter({
    
            history:VueRouter.createWebHashHistory(),
            routes:
            [
                {
                    path:'/',
                    component:Home
                },
                {
                    path:'/account',
                    component:Account
                }
            ]

})
        const appObj=Vue.createApp({})
        appObj.use(router)
        appObj.mount('#app')
            
</script>
</body>
</html>